import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUserStore = defineStore('user', () => {
  const user = ref({})
  const changeUser = (value) => {
    user.value = value
  }
  const removeUser = () => {
    user.value = {}
  }
  // 改变路由信息
  const changeRoute = (value) => {
    user.value.role.rights = value
  }
  return {
    user,
    changeUser,
    removeUser,
    changeRoute
  }
},
  {
    persist: true
  })

